home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
progs
/
editor
/
frexxed
/
fpl
/
backup.fpl
< prev
next >
Wrap
Text File
|
1995-07-18
|
1KB
|
35 lines
/******************************
* Read Backup.FPL.README! *
* Written by Daniel Stenberg *
******************************/
export int Save_hook(string filename, string packmode)
{
if(ReadInfo("backup")) {
string command;
string dest;
int ret;
if(!strlen(filename)) {
filename = ReadInfo("full_file_name");
}
dest = joinstr("\"", filename, ReadInfo("backup_suffix"), "\"");
/* check for the file */
if(Check(joinstr(filename, ReadInfo("backup_suffix")))) {
ret=Request(joinstr("Backup file ", dest, " already exists!\n"
"Do you want to replace it?"));
}
if(ret) {
Status(0, "Backuping...");
System(joinstr("copy >NIL: CLONE \"", filename, "\" ", dest));
}
SetInfo(-1, "_backup", 1); /* backuped or selected not to become so! */
}
}
ConstructInfo("_backup", "", "", "HBL", "", 0, 1);
ConstructInfo("backup", "", "", "WBL(io)", "", 0, 1, -1); /* default is enabled */
ConstructInfo("backup_suffix", "", "", "WSG(io)", "", 0, 0, ".bak"); /* default is enabled */
/* Make Save() call Save_hook() if '_backup' isn't set! */
Hook("Save", "Save_hook", "!_backup");